class KeyDetectionModel(nn.Module):
    def __init__(self, num_keys=24):  # 12 major + 12 minor
        super().__init__()
        self.cnn = nn.Sequential(
            nn.Conv1d(128, 64, kernel_size=5),
            nn.ReLU(),
            nn.MaxPool1d(2),
            nn.Conv1d(64, 32, kernel_size=3)
        )
        self.fc = nn.Linear(32*60, num_keys)

    def forward(self, x):
        return self.fc(self.cnn(x).view(x.size(0), -1))